package com.geek.javase.ch18.videodemo.reflect;

/*
 *@Date 2025/11/5
 *@Author wangpeng
 *@Description TODO
 */
public class Student extends Person{
    //成员属性
    private String name;
    private int age;

    //内部类
    class InnerClass{
        private String level;
        public  void print(){
            System.out.println(name+"在"+level+"年级上学！");
        }
    }
    //公开的成员方法
    public void study(){
        System.out.println(age+"岁的学生，正在学习中！");
    }
    //私有的成员方法
    private int sleep(){
        System.out.println("正在睡觉中...");
        return age;
    }

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }


    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return age
     */
    public int getAge() {
        return age;
    }

    /**
     * 设置
     * @param age
     */
    public void setAge(int age) {
        this.age = age;
    }

    public String toString() {
        return "Student{name = " + name + ", age = " + age + "}";
    }

}
